package com.liurz.service.impl;

import com.liurz.entity.TbConf;
import com.liurz.mapper.TbConfMapper;
import com.liurz.service.TbConfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class TbConfServiceImpl implements TbConfService {
    @Autowired
    private TbConfMapper tbConfMapper;
    @Override
    public TbConf getOne(String confId) {
        return tbConfMapper.selectByPrimaryKey(confId);
    }

    @Override
    public List<TbConf> findByCondition(TbConf tbConf) {
        Example example = new Example(TbConf.class);
        example.createCriteria().andEqualTo("confId",tbConf.getConfId());
        return tbConfMapper.selectByExample(example);
    }

    @Override
    public List<TbConf> getAll() {
        return tbConfMapper.getAll();
    }

    @Override
    public TbConf getOneByConfId(String confId) {
        return tbConfMapper.getByConfId(confId);
    }

}
